package com.imooc.order.utils;

import java.util.Random;

/**
 * @author wy
 * @version 1.0
 * @date 2020/3/5 11:44
 * @description
 **/
public class KeyUtil {

    /**
     * 生成唯一的主键
     * @return
     */
    public static synchronized String genUniqueKey(){

        Random random = new Random();
        Integer number = random.nextInt(900000)+100000;
        return System.currentTimeMillis() + String.valueOf(number);
    }
}
